//4.编写一个函数，用指针变量做参数，用于求出一个浮点型数组元素的平均值
#include<stdio.h>
#define N 6
float average(float *p,int n)
{
	float aver,sum = 0;
	float *q = p + n - 1;
	for(;p <= q;p++)
	{
		sum += *p;
	}
	aver = sum / n;
	return aver;
} 
int main()
{
	float f[N] = {11.0f,15.0f,68.0f,45.5f,63.5f,75.6f};
	float *p = f;
	float aver = average(p,N);
	printf("该数组平均值为：%f\n",aver);
	return 0;
}
